<template>
    <h1>用户投资明细</h1>

    <table class="table table-bordre" border="1">
        <thead>
            <tr>
                <th>投资人登录账号</th>
                <th>投资金额</th>
                <th>投资时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in UserInfo "  >
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.UI_Money }}</td>
                <td>{{ (item.UI_Date).substring(0,10) }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const route = useRoute();
//alert(route.params.Iid);

const Iid = route.params.Iid;

const UserInfo = ref([{
    UL_Name:'',
    UI_Money:'',
    UI_Date:'',
}]);

onMounted ( ()=>{
    axios({
        url:"http://localhost:53279/api/Invest/GetAllUserInvestInfo",
        method:"get",
        params:{
            Iid:Iid,
        }
    })
    .then(function(res){
        console.log(res.data);
        UserInfo.value = res.data;
    })
    .catch(function(err){
        console.log(err);
    })
})


</script>